package com.shy.example.alibaba.provider.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("dept")
@Slf4j
public class DeptController {

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("nacos/{id}")
    public String getPayment(@PathVariable("id") Long id){
        String result = "<h2>本网站提醒您，服务访问成功！</h2>服务名：spring-cloud-alibaba-provider<br/>" +
                "端口号： " + serverPort + "<br/>传入参数：" + id;
        log.info("result: {}", result);
        return result;
    }
}
